package com.itcast.googleplay.adapter;

import java.util.List;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public abstract class MyBaseAdapter1<T> extends BaseAdapter {
	public List<T> list;

	public MyBaseAdapter1(List<T> list) {
		//T 泛型  任意类型
		this.list = list;
	}
	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public T getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	//返回listView中一个条目的view对象,并且给其附上数据
	@Override
	public abstract View getView(int position, View convertView, ViewGroup parent);

}
